<template>
    <el-form label-width="80px" class="text-align-left">
        <el-form-item label="市场价格">
            <el-input type="number" 
            placeholder="请输入内容" 
            :value="oprice"  
            @input="vModel('oprice',$event)" 
            class="w-25">
                <template slot="append">元</template>
            </el-input>
        </el-form-item>
        <el-form-item label="销售价格">
            <el-input type="number" 
            placeholder="请输入内容" 
            :value="pprice"  
            @input="vModel('oprice',$event)"  
            class="w-25">
                <template slot="append">元</template>
            </el-input>
        </el-form-item> 
        <el-form-item label="成本价格">
            <el-input type="number" 
            placeholder="请输入内容" 
            :value="cprice"  
            @input="vModel('cprice',$event)"  
            class="w-25">
                <template slot="append">元</template>
            </el-input>
        </el-form-item> 
        <el-form-item label="商品重量">
            <el-input type="number" 
            placeholder="请输入内容" 
            :value="weight"  
            @input="vModel('weight',$event)" 
             class="w-25">
                <template slot="append">公斤</template>
            </el-input>
        </el-form-item>
        <el-form-item label="商品体积">
            <el-input type="number" placeholder="请输入内容" 
            :value="volume"  
            @input="vModel('volume',$event)"  
            class="w-25">
                <template slot="append">立方米</template>
            </el-input>
        </el-form-item>
    </el-form>
</template>
<script>
import { mapState, mapMutations } from 'vuex';

export default{
    data(){
        return{
       
        }
    },
    computed: {
        ...mapState('goods_create', {
            skus_type: state => state.skus_type,

            pprice: state => state.pprice,
            oprice: state => state.oprice,
            cprice: state => state.cprice,
            weight: state => state.weight,
            volume: state => state.volume,
        }),
        //    其他计算属性
    },
    methods: {
        // 修改state方法二
        ...mapMutations('goods_create',['vModelState']),
        // 修改表单的值
        vModel(key,value){
            this.vModelState({
                key,
                value
            })
        }

    }
}
</script>
<style>

</style>